<link rel="stylesheet" href="{{ URL::asset('/ucenter/css/base.css') }}">
<script type="text/javascript" src="{{ URL::asset('public_js/jquery-1.8.3.min.js') }}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/highcharts.js') }}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/highcharts-3d.js')}}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/highcharts-zh_CN.js')}}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/modules/exporting.js') }}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/highcharts-more.js') }}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/modules/solid-gauge.js') }}"></script>
<script>
    function profit(id,data){
        var t = this;
        return new Highcharts.Chart({
            chart: {
                renderTo: id,
                type: "areaspline",
                zoomType: "xy",
                backgroundColor: '#171922'
            },
            title: {
                text : null
            },
            subtitle: {
                text: null,
                align: 'left',
                verticalAlign: 'bottom'
            },
            colors: ["#ffc766"],
            legend: {
                enabled: false
            },
            credits: {
                enabled: false
            },
            exporting: {
                enabled:false
            },
            xAxis: {
                lineWidth: 0, //去掉坐标轴
                gridLineWidth: 0,
                tickLength: 0, // 去掉坐标轴刻度线
                categories:data[0],
                labels: {
                    enabled: !1
                }
            },
            yAxis: {
                gridLineWidth: 0,
                labels: {// 去掉Y轴
                    enabled: !1
                },
                title: {
                    text: null
                }
            },
            tooltip: {
                style: {
                    color: "white"
                },
                borderWidth: 1,
                shadow: !1,
                shared: !0,
                backgroundColor: 'rgba(0,0,0)',   // 背景颜色
                borderColor: '#e99d32',       // 边框颜色
                formatter : function (){ // 提示框格式化字符串
                    var s;
                    $.each(this.points ,function(){
                        s = '<b>总收入: ' + this.y+'点'+'</b><br/>';
                    });
                    s += '<b>截止: '+this.x+'</b>';
                    return s;
                }
            },
            plotOptions: {
                areaspline: {
                    fillColor: {
                        linearGradient: {
                            x1: 0,
                            y1: 0,
                            x2: 0,
                            y2: 1
                        },
                        stops: [
                            [0, "#171923"],
                            [1, Highcharts.Color("#171923" , "#171923").setOpacity(0).get('rgba')]
                        ]
                    },
                    marker: {
                        radius: 0,
                        fillColor: "white",
                        lineWidth: 1,
                        lineColor: "#ffc766"
                    },
                    lineWidth: 1,
                    states: {
                        hover: {
                            lineWidth: 1
                        }
                    },
                    threshold: null
                },
                series: {
                    lineColor: "#e99d32"
                }
            },
            series: [{
                name: "盈利点位",
                data: data[1]
            }]
        })
    }
</script>
<style>
/* 跟随者 */
.L_title{
    text-indent:30px;
    height: 70px;
    line-height:70px;
    font-size:14px;
}
.L_dingmaster {
    /*width: 88%;*/
    min-height: 460px;
    background: #1e2635;
    float: left;
    padding: 0 70px;
}
.L_dingmaster > ul {
    overflow: hidden;
}
.L_dingmaster > ul > li {
    float: left;
    width: 280px;
    height: 400px;
    background: #171923;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 32px;
    position: relative;
}
.L_dingmaster > ul > li.L_margin {
    margin: 0 40px;
    margin-top: 32px;
}
.L_dingmaster > ul > li > div.li_mask {
    width: 280px;
    height: 400px;
    background: rgba(23,25,35,.6);
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}
.L_dingmaster .L_photo {
    height: 60px;
    margin-top: 12px;
    margin-left: 18px;
    margin-right: 14px;
}
.L_dingmaster .L_photo > div {
    float: left;
}
.L_dingmaster .L_photo > div:first-child {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
}
.L_dingmaster .L_photo > div:first-child img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.L_dingmaster .L_photo > div:nth-child(2) {
    padding-top: 2px;
}
.L_dingmaster .L_photo > div:nth-child(2) p:first-child {
    font-size: 14px;
    color: #bbbbbb;
}
.L_dingmaster .L_photo > div:nth-child(2) p:last-child {
    font-size: 12px;
    color: #bbbbbb;
}
.L_dingmaster .L_photo > div:last-child {
    float: right;
    line-height: 28px;
    text-align: center;
    width: 80px;
    height: 28px;
    border-radius: 12px;
    border: 1px solid #3b9ce0;
    color: #3b9ce0;
    font-size: 12px;
    margin-top: 12px;
    cursor: pointer;
}
.L_dingmaster .L_chart {
    width: 260px;
    height: 120px;
    margin: 0 auto;
}
.L_dingmaster .L_profitNum > p {
    text-align: center;
    font-size: 14px;
    color: #fff;
    line-height: 30px;
}
.L_dingmaster .L_profitNum > p:first-child {
    font-size: 30px;
    font-weight: 600;
    color: #fb405a;
}
.L_dingmaster .L_dingData {
    height: 36px;
    width: 320px;
    margin-top: 26px;
}
.L_dingmaster .L_dingData > div {
    float: left;
    width: 86px;
}
.L_dingmaster .L_dingData > div > p {
    text-align: center;
    font-size: 12px;
    color: #bbbbbb;
    line-height: 20px;
}
.L_dingmaster .L_dingData > div > p.bigfont {
    font-size: 14px;
    color: #fff;
}
.L_dingmaster .L_dingData > div.line {
    width: 1px;
    height: 36px;
    background: #88888b;
}
.L_dingmaster .L_dingTime {
    margin: 0 18px;
    margin-top: 26px;
}
.L_dingmaster .L_dingTime > span {
    font-size: 12px;
    color: #bbbbbb;
}
.L_dingmaster .L_dingTime > span:first-child {
    display: inline-block;
    width: 142px;
}
/*右侧列表*/
.L_masterList {
    float: left;
    padding-left: 100px;
}
.L_masterList p {
    font-size: 12px;
    color: #88888b;
    line-height: 36px;
}
/* 历史跟随 */
.history-list  {
    margin-top: 0px;
    height: 1000px;
}
.history-list .title {
    margin-left: 30px;
    font-size: 14px;
    font-weight: bold;
    color: #20222C; 
    height: 50px;
    line-height: 50px;
}
</style>
@if($mefollowdata)
<div class="L_dingyue" style="height: 530px;">
    <div class="L_title">正在订阅</div>
    <div class="L_dingmaster">
        <ul>
            @foreach($mefollowdata as $mkey=>$mval)                         
                <li @if($mkey == 1) class="L_margin clearfix" @endif>
                    <div class="L_photo">
                        <div>
                            <a href="{{url('/analysthome?id='.$mval->analyst_id)}}" target="_blank" style="cursor:pointer;">
                                <img src="{{$mval->photo ? $mval->photo : URL::asset('ucenter/images/head.png')}}" alt="">
                            </a>
                        </div>
                        <div>
                            <p>
                                <a href="{{url('/analysthome?id='.$mval->analyst_id)}}" target="_blank" style="cursor:pointer;color:#bbbbbb;">
                                    {{$mval->username}}
                                </a>    
                            </p>
                            <p>@if($mval->direction == 0) 正向订阅 @else 反向订阅 @endif</p>
                        </div>
                        @if(session('eai')['id'] == $id)
                            <div onclick="topcanclefollow(this)" analyst_id="{{$mval->analyst_id}}" analyst_username="{{$mval->username}}" status="{{$mval->status}}" direction="{{$mval->direction}}">取消订阅</div>
                        @else
                            <div style="border-color:#bbbbbb;color: #bbbbbb; ">取消订阅</div>
                        @endif
                    </div>
                    <div class="L_chart">
                        <div id="{{$mval->username}}" style="width:260px;height: 120px;"></div>
                    </div>
                    <div class="L_profitNum">
                        <p>
                            @if($mval->zong_final_point >= 0)
                                {{round($mval->zong_final_point,2)}}
                            @else
                                -{{abs(round($mval->zong_final_point,2))}}
                            @endif    
                        </p>
                        <p>订阅收益</p>
                    </div>
                    <div class="L_dingData">
                        <div>
                            <p class="bigfont">{{$mval->ordercount}}</p>
                            <p>订阅单量</p>
                        </div>
                        <div class="line"></div>
                        <div>
                            <p class="bigfont">
                                @if($mval->avg_final_point >= 0)
                                    {{round($mval->avg_final_point,2)}}
                                @else
                                    -{{abs(round($mval->avg_final_point,2))}}
                                @endif 
                            </p>
                            <p>单均</p>
                        </div>
                        <div class="line"></div>
                        <div>
                            <p class="bigfont">{{round($mval->winrate,2)}}%</p>
                            <p>胜率</p>
                        </div>
                    </div>
                    <div class="L_dingTime">
                        <span>订阅时间</span>
                        <span>@if($mval->update_time){{date("Y-m-d",$mval->update_time)}}@else{{date("Y-m-d",$mval->follow_time)}}@endif</span>
                    </div>
                </li>
                <script>
                    var x_chart_time  = '{{$mval->timesstr}}';
                    var x_chart_point = '{{$mval->pointstr}}';
                    x_chart_point     = x_chart_point.split(',');
                    var x_chart_data  = [];
                    x_chart_point.forEach(function(data,index,arr){
                        x_chart_data.push(+data);
                    });
                    profit('{{$mval->username}}',[x_chart_time.split(','),x_chart_data]);
                </script>
            @endforeach
        </ul>
    </div>
<!--    <div class="L_masterList">
        <h3>收益统计</h3>
        <p>订阅总收益</p>
        <p style="color: #fb405a;">${{$dingYueInfo[0]->allProfit}}</p>
        <p>订阅周期</p>
        <p>15天</p>
        <p>单均订阅收益</p>
        <p style="color: #fb405a;">${{$dingYueInfo[0]->avgProfit}}</p>
    </div>-->
</div>
@else
    
    <div class="L_dingyue" style="height: 530px;">
        <div class="L_title">正在订阅</div>
        <div class="L_dingmaster">
        <ul>
            @for($i=0;$i<3;$i++)
            <li @if($i == 1) class="L_margin clearfix" @endif>
                    <div class="L_photo">
                        <div><img src="{{ URL::asset('images/shiliang.png') }}" alt=""></div>
                        <div>
                            <p>分析师</p>
                            <p> 订阅方向 </p>
                        </div>
                        <div style="border-color: #bbbbbb;color: #bbbbbb;">取消订阅</div>
                    </div>
                    <div class="L_chart">
                           <img src="{{ URL::asset('/images/newchart.png') }}" alt="">
                    </div>
                    <div class="L_profitNum">
                        <p>0</p>
                        <p>订阅收益</p>
                    </div>
                    <div class="L_dingData">
                        <div>
                            <p class="bigfont">0</p>
                            <p>订阅单量</p>
                        </div>
                        <div class="line"></div>
                        <div>
                            <p class="bigfont">0</p>
                            <p>单均</p>
                        </div>
                        <div class="line"></div>
                        <div>
                            <p class="bigfont">0</p>
                            <p>胜率</p>
                        </div>
                    </div>
                    <div class="L_dingTime">
                        <span>订阅时间</span>
                        <span>0000-00-00</span>
                    </div>
                    <div class="li_mask"></div>
                </li>
                @endfor
        </ul>
        </div>
    </div>
    

@endif
<!-- 历史订阅 -->
<div class="L_lishi">
    <div class="L_title">历史订阅</div>
    <div class="history">
        <!-- 历史订阅列表 -->
        <div class="history-list">
            <iframe name="historyiframeMain" id="historyiframeMain" src="{{url('/newhistoryfollow?id=')}}{{$id}}" scrolling="no" frameborder="0" width="100%" height="1000">
            </iframe>
        </div>
    </div>
</div>
